﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:wpapp"
    x:Class="wpapp.Page2"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">

    <phone:PhoneApplicationPage.Resources>
        <local:review x:Key="reviewDataSource" d:IsDataSource="True"/>
        <local:product x:Key="productDataSource" d:IsDataSource="True"/>

    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>
    <ScrollViewer DataContext="{Binding Source={StaticResource productDataSource}}">

        <Grid x:Name="LayoutRoot" Height="780" Width="480" DataContext="{Binding Source={StaticResource reviewDataSource}}">
            <Grid.Background>
                <ImageBrush Stretch="Fill" ImageSource="/tiankongjsczwp6.jpg"/>
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel HorizontalAlignment="Center" Height="61" Grid.RowSpan="2" VerticalAlignment="Top" Width="480">
                <TextBlock TextWrapping="Wrap" Text="商品详情" Height="60" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="147,0,167,0" Width="166" FontSize="40"/>
            </StackPanel>
            <Grid HorizontalAlignment="Left" Height="243" Grid.RowSpan="2" VerticalAlignment="Top" Width="470" Margin="0,66,0,0">
                <StackPanel Width="470" Margin="0,0,0,2">
                    <Image x:Name="theimg" Height="155" Source="{Binding imgurl}"/>
                    <StackPanel HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="470" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Text="商品名：" HorizontalAlignment="Left" Width="155"/>
                        <TextBlock x:Name="thepdtn" TextWrapping="Wrap" Text="{Binding productname}" Width="314"/>
                    </StackPanel>
                    <StackPanel HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="470" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Text="商品介绍：" HorizontalAlignment="Left" Width="155" Height="31" VerticalAlignment="Bottom"/>
                        <TextBlock TextWrapping="Wrap" Text="TextBlock" Width="314"/>
                    </StackPanel>
                    <StackPanel HorizontalAlignment="Left" Height="31" VerticalAlignment="Top" Width="470" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Text="发布时间：" HorizontalAlignment="Left" Width="155"/>
                        <TextBlock x:Name="thepdttime" TextWrapping="Wrap" Text="{Binding time}" Width="314"/>
                    </StackPanel>

                </StackPanel>
            </Grid>
            <Grid HorizontalAlignment="Center" Grid.RowSpan="2" Width="480" Margin="0,327,0,10" DataContext="{Binding}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="51*"/>
                    <ColumnDefinition Width="49*"/>
                </Grid.ColumnDefinitions>
                <StackPanel x:Name="ReviewsPanel" Grid.ColumnSpan="2" Margin="0,0,10,0" DataContext="{Binding Source={StaticResource reviewDataSource}}" >
                    <StackPanel Height="47" VerticalAlignment="Top" Orientation="Horizontal">
                        <TextBlock TextWrapping="Wrap" Text="-------------最新评论------------" Height="45" Width="280" HorizontalAlignment="Center" Margin="0,1" VerticalAlignment="Center"/>
                        <HyperlinkButton Content="查看/刷新评论" Width="199" Click="HyperlinkButton_Click"/>


                    </StackPanel>
                    <ListBox x:Name="lbReviews" ItemsSource="{Binding}" Margin="9,0,0,0" Height="334" Width="460" DataContext="{Binding BindsDirectlyToSource=True}" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Width="460" Height="50" >
                                    <TextBlock TextWrapping="Wrap" Text="{Binding pinglun, Mode=TwoWay}" Width="377"/>
                                    <TextBlock TextWrapping="Wrap" Text="{Binding pltime, Mode=TwoWay}" Width="91"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
                <StackPanel HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="474" Margin="0,379,0,0" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2">
                    <TextBox Height="72" TextWrapping="Wrap" Text="TextBox" KeyDown="TextBox_KeyDown"/>
                </StackPanel>

            </Grid>

        </Grid>

    </ScrollViewer>

</phone:PhoneApplicationPage>